/* find the layers within the network matrix, determine a location within the view for each neuron (circle), draw lines to represent the network with color and thickness varying according to + & - values and the size of the value.
*/
- initNetworkDisplay
{
int NeuronLayer[NUM_NODES]; // array to store neurons in layers
NXPoint theLoc;
NXCoord viewX = bounds.size.width; // get X & Y size of view
NXCoord viewY = bounds.size.height;
int i,oldi,j,layer,count;
float Xspacing, Yspacing, Xoffset, Yoffset;
i=oldi=j=layer=count=0;
// find layers within network matrix.
while (i < NUM_NODES)
{
for (; i < NUM_NODES; i++)
{
for (j=oldi; j < i; j++)
if (Network[i][j] != 0)
break; //exit this for loop...
if (Network[i][j] != 0)
break; //exit this for loop...
}
NeuronLayer[layer] = i - oldi; // # of neurons in layer.
layer++;
oldi = i;
}
// determine a location for each neuron within window (view)